package com.qinghe.pro.controller.file;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qinghe.pro.entity.Progress;
import com.qinghe.utils.Utils;

@Controller
@RequestMapping("/fileStatus")
public class ProgressController {

	@RequestMapping(method = RequestMethod.GET)
	@ResponseBody
	public String fileStatus(HttpServletRequest request) {
		Progress status = (Progress) request.getSession().getAttribute("status");
		if (status == null) {
			return "{}";
		}
		return Utils.JsonUtil.toJson(status);
	}

}
